package operation;

import book.Book;
import book.Booklist;

import java.util.Scanner;

public class BorrowedOperation implements IOPeration{
    public void work(Booklist booklist){
        System.out.println("借出图书。。。。。");
        System.out.println("请输入要借的书名");
        Scanner scanner=new Scanner(System.in);
        String bookName=scanner.nextLine();
        int currentSize=booklist.getUsedSize();
        for(int i=0;i<currentSize;i++){
            Book book=booklist.getBook(i);
            if(booklist.getBook(i).equals(bookName)){
                book.setLend(true);
                System.out.println("成功借出！");
               return;
            }
        }

    }
}
